<?php
header('content-type:text/html;charset=utf-8');
$mysqli = new Mysqli("localhost","root","root","db_mbl");
if($mysqli->connect_errno){
    die();
}
$phone=$_POST["phone"];
$shopUrl=$_POST["shopUrl"];
$title=$_POST["title"];
$price=$_POST["price"];
$sql = "insert into shopping (phone,shopUrl,title,price) values (${phone},'${shopUrl}','${title}',${price})";
$res = $mysqli->query($sql);
if ($res){
    $data["code"] = 1;
}else{
    $data["code"] = 0;
}
print_r(json_encode($data));
?>
